package com.yz.dadatasource.dynamic;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.yz.dadatasource.dynamic.mapper.Order;
import com.yz.dadatasource.dynamic.mapper.OrderMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.concurrent.TimeUnit;

@SpringBootApplication(exclude= {DruidDataSourceAutoConfigure.class})
@MapperScan("com.yz.dadatasource.dynamic.mapper")
//@SpringBootApplication
public class DynamicApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext context =SpringApplication.run(DynamicApplication.class, args);
        OrderService bean = context.getBean(OrderService.class);
//        for (int i=0;i<20;i++)
//            System.out.println(bean.select(1));


//        for (int i=0;i<20;i++)
//            bean.insert(new Order("zhangsan"+i,i));
    }

}
